def main(str):
    org = str.split(' ')
    print(org)
    new = []
    while org:
        unit = org.pop()
        new.append(unit)
    print(new)
    return new

def main2():
    while 1:
        try:
            b = []
            a = input()
            for i in a:
                if not i.isalpha():
                    a = a.replace(i, ' ')
            for i in a.split():
                b.append(i)
            print(" ".join(b[::-1]))
        except:
            break

# 2.字符串排序
def str_main():
    while True:
        try:
            line = input().split()
            line = line[0] + line[1]
            lineA, lineB, lineRes, lineTrans = '', '', '', ''
            for i in range(len(line)):
                if i % 2 == 0:
                    lineA += line[i]  # oushu
                else:
                    lineB += line[i]  # jishu
            lineA, lineB = sorted(lineA), sorted(lineB)
            for i in range(len(lineB)):
                lineRes += lineA[i]
                lineRes += lineB[i]
            if len(lineA) > len(lineB):
                lineRes += lineA[i + 1]

            for i in lineRes:
                if i in '0123456789abcdefABCDEF':
                    temp = bin(int('0x' + i, 16))[2:]
                    temp = (4 - len(temp)) * '0' + temp
                    temp = (hex(int(temp[::-1], 2))[2:]).upper()
                else:
                    temp = i
                lineTrans += temp
            print(lineTrans)
        except:
            break
s = '$bo*y gi!r#l #'
main(s)

